﻿//*****************************************************************************
//
//  Silver Games - Checkers
//  Copyright © 2009 Randi Relander
//      <rjrelander@users.sourceforge.net>
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
//*****************************************************************************

namespace Checkers.Common
{
    public enum TileColor
    {
        Red,
        Black
    };

    public enum Direction
    {
        NorthEast,
        NorthWest,
        SouthWest,
        SouthEast
    };

    public class Tile
    {
        public Tile(Board board, TileColor color, int x, int y)
        {
            mBoard = board;

            mColor = color;

            mX = x;
            mY = y;
        }

        public Tile GetNextTile(CheckerColor color, Direction direction, int distance)
        {
            return Board.GetNextTile(this, color, direction, distance);
        }

        Board mBoard;

        TileColor mColor;

        int mX;

        int mY;

        public Board Board { get { return mBoard; } }

        public TileColor Color { get { return mColor; } }

        public int X { get { return mX; } }

        public int Y { get { return mY; } }

        public Checker Checker { get; set; }
    }
}
